Skip to main content
Version: 2.17.x.x LTS

Integration with Web Services

The web-service-based event sources can be used without additional configuration.

To invoke the SOAP web service, client stubs have to be generated using the WSDL and XML schema files. Both files can be found in nevisdp-wsclient.jar. The generation of the client‘s stubs depends on the programming language and/or the WS framework in use. The JAR nevisdp- wsclient.jar contains client stub classes for the Java programming language using the JAX-WS framework.

Example:

WebEventService service = new WebEventService();
WebEvent port = service.getWebEventPort();
BindingProvider prov = (BindingProvider) port;
prov.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
port.signal(eventData);

To call the REST web service no stubs need to be generated. However, it is more convenient to use a REST client library such as the Jersey RS client for Java.

Example for /query interface:

Client client = Client.create();
WebResource rsQuery = client.resource(endpoint + "/query");
rsQuery.queryParam("key1", "value1").queryParam("key2", "value2").post();

Example for /data interface:

Client client = Client.create();
WebResource rsData = client.resource(endpoint + "/data");
rsData.entity(eventData, MediaType.APPLICATION_XML).post();